<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <ul>
        <li><router-link to="/home">Home</router-link></li>
      </ul>
      <div>
        <router-view name="header"></router-view>
        <router-view></router-view>
        <router-view name="footer"></router-view>
      </div>
      
    </div>
    <script src="vue.js"></script>
    <script src="vue-router.js"></script>
    <script>
      const Home = {
        template: `<div>Home</div>`,
      };
      const Layout = {
        template: `<div>Home</div>`,
      };
      const LayoutHeader = { template: `<div>LayoutHeader</div>`};
      const LayoutBody = { template: `<div>LayoutBody</div>`};
      const LayoutFooter = { template: `<div>LayoutFooter</div>`};
      const routes = [
        { name: "home", path: "/home", component: Home },
        {
          name:'layout',
          path:'/layout',
          components:{
            header:LayoutHeader,
            default:LayoutBody,
            footer:LayoutFooter
          }
        }
      ];
      var router = new VueRouter({
        routes,
      });
      var vm = new Vue({
        el: "#app",
        router,
      });
    </script>
  </body>
</html>
